package com.dzsw.test.mybatisp.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dzsw.test.mybatisp.entity.User;
import com.dzsw.test.mybatisp.mapper.UserExtMapper;
import com.dzsw.test.mybatisp.mapper.UserMapper;
import com.dzsw.test.mybatisp.service.IUserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 用户表 服务实现类
 * </p>
 *
 * @author admin
 * @since 2020-08-12
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IUserService {

    @Resource
    private UserMapper mapper;

    @Resource
    private UserExtMapper userExtMapper;

    public List<User> selectList() {
        return mapper.selectList(null);
    }

    @Override
    public List<User> s1(int page, int size) {
        Page<User> p = new Page<>();
        p.setSize(size);
        p.setCurrent(page);
        List<User> list = userExtMapper.selectPageVo(p, 1);
        return list;
    }
}
